<template>

	<view>
		<view class="search_flex">
			<view class="search">
				<image class="ico" src="../../static/ico_ss.png" mode="widthFix"></image>
				<input class="input" placeholder-class="placeholder" v-model="keyword" type="text"
					placeholder="搜索学员名字/手机号" />
			</view>
			<view class="btn_screen" @click="openScreen">
				<image class="ico" src="../../static/ico_s1.png" mode="widthFix"></image>
				<view class="text">筛选</view>
			</view>
		</view>

		<view class="student_list">
			<view class="item" v-for="(item,index) in 5" @click="gotoInfo">
				<image class="ph" src="../../static/ico_head.png" mode="aspectFill"></image>
				<view class="name">
					施涵涵
				</view>
			</view>
		</view>

		<uv-popup ref="popup" mode="right" :safeAreaInsetBottom="true" @change="changeScreen">
			<view class="screen_popup">
				<view class="title">
					筛选
				</view>
				<view class="screen_list">
					<view class="screen_item">
						<view class="name" @click="openPicker">
							学生来源
						</view>
						<view class="picker">
							<text>请选择</text>
							<uv-icon name="arrow-right" color="#BEBEBE" size="24rpx"></uv-icon>
						</view>
					</view>
					<view class="screen_item" @click="openPicker">
						<view class="name">
							班级老师
						</view>
						<view class="picker">
							<text>请选择</text>
							<uv-icon name="arrow-right" color="#BEBEBE" size="24rpx"></uv-icon>
						</view>
					</view>
					<view class="screen_item" @click="openPicker">
						<view class="name">
							标签
						</view>
						<view class="picker">
							<text>请选择</text>
							<uv-icon name="arrow-right" color="#BEBEBE" size="24rpx"></uv-icon>
						</view>
					</view>
					<view class="screen_item" @click="openPicker">
						<view class="name">
							班级
						</view>
						<view class="picker">
							<text>请选择</text>
							<uv-icon name="arrow-right" color="#BEBEBE" size="24rpx"></uv-icon>
						</view>
					</view>
				</view>

				<view class="screen_btn">
					<view class="btn_white">
						重置
					</view>
					<view class="btn_org">
						确定
					</view>
				</view>


			</view>
		</uv-popup>

		<uv-picker ref="picker" :columns="columnsPicker" @confirm="confirmPicker"></uv-picker>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: '',
				columnsPicker: [
					['数据1', '数据2', '数据3']
				]
			}
		},
		onLoad() {

		},
		methods: {
			gotoInfo() {
				uni.navigateTo({
					url: '/pages/studentInfo/studentInfo'
				});
			},
			openPicker() {
				this.$refs.picker.open();
			},
			confirmPicker() {

			},
			openScreen() {
				this.$refs.popup.open();
			},
			changeScreen(e) {
				console.log('弹窗状态改变：', e);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.screen_popup {
		position: relative;
		width: 650rpx;
		height: 100%;
		background: #F7F8FA;

		.title {
			text-align: center;
			background: #fff;
			font-size: 30rpx;
			color: #3D3D3D;
			line-height: 40rpx;
			padding: 20rpx;
		}

		.screen_list {
			background: #fff;
			padding: 0 36rpx 15rpx;
		}

		.screen_item {

			padding: 20rpx 0;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.name {
				flex-shrink: 0;
				font-size: 30rpx;
				color: #3D3D3D;
				line-height: 42rpx;
			}

			.picker {
				display: flex;
				align-items: center;
				color: #BEBEBE;
				font-size: 30rpx;
				line-height: 42rpx;

				text {
					padding-right: 8rpx;
				}
			}
		}

		.screen_btn {
			position: absolute;
			left: 0;
			right: 0;
			bottom: 0;
			padding: 15rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.btn_white {
				width: 300rpx;
				height: 84rpx;
				line-height: 84rpx;
				text-align: center;
				background: #FFFFFF;
				box-sizing: border-box;
				border: 2rpx solid #FF8535;
				font-size: 28rpx;
				color: #FF8535;
			}

			.btn_org {
				width: 300rpx;
				height: 84rpx;
				line-height: 84rpx;
				text-align: center;
				background: #FF8535;
				color: #fff;
				font-size: 28rpx;
			}
		}
	}

	.student_list {
		.item {
			width: 100%;
			height: 160rpx;
			box-sizing: border-box;
			border-bottom: 1px solid rgba(230, 229, 231, 0.8);
			padding: 0 40rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			background: #fff;

			.ph {
				display: block;
				flex-shrink: 0;
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
				margin-right: 20rpx;
				font-size: 0;
			}

			.name {
				width: 100%;
			}
		}
	}

	.search_flex {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx 40rpx;
		border-bottom: 1px solid rgba(230, 229, 231, 0.8);
		background: #fff;

		.search {
			width: 100%;
			height: 80rpx;
			background: #F7F7F9;
			display: flex;
			align-items: center;
			border-radius: 16rpx;
			padding: 0 20rpx;

			.ico {
				flex-shrink: 0;
				width: 40rpx;
				height: 40rpx;
				margin-right: 15rpx;
				opacity: 0.8;
			}

			.input {
				display: block;
				width: 100%;
				background: none;
				border: none;
				font-size: 28rpx;
				color: #333;
				height: 40rpx;
				line-height: 40rpx;
			}

			.placeholder {
				color: #BEBEBE;
			}
		}

		.btn_screen {
			flex-shrink: 0;
			display: flex;
			align-items: center;
			padding: 0 8rpx;
			margin-left: 20rpx;

			.ico {
				flex-shrink: 0;
				width: 30rpx;
				height: 32rpx;
				margin-right: 10rpx;
			}

			.text {
				color: #3D3D3D;
				font-size: 28rpx;
			}
		}
	}
</style>